package com.wanxi.controller;

import com.wanxi.dto.ResultDTO;
import com.wanxi.service.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin/permission")
public class PermissionController {

    @Autowired
    PermissionService permissionService;

    @GetMapping("/findAll")
    @PreAuthorize("hasAuthority('updatePermission')")
    public ResultDTO findAllPermission(){
        return permissionService.findAllPermission();
    }
}
